<template>
  <div class="demo-pagination-block">
    <div class="demonstration"></div>
    <el-pagination :current-page="currentPage4" :page-size="pageSize4" :page-sizes="[5, 10, 15]" :small="small"
      :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper" :total="40"
      @size-change="handleSizeChange" @current-change="handleCurrentChange" />
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'PaginationInfo',
  setup() {
    const currentPage1 = ref(5)
    const currentPage2 = ref(5)
    const currentPage3 = ref(5)
    const currentPage4 = ref(1)
    const pageSize2 = ref(10)
    const pageSize3 = ref(10)
    const pageSize4 = ref(10)
    const small = ref(false)
    const background = ref(false)
    const disabled = ref(false)
    const handleSizeChange = (val) => {
      console.log(`${val} items per page`)
    }
    const handleCurrentChange = (val) => {
      console.log(`current page: ${val}`)
    }
    return {
      currentPage1,
      currentPage2,
      currentPage3,
      currentPage4,
      pageSize2,
      pageSize3,
      pageSize4,
      small, background,
      disabled,
      handleSizeChange,
      handleCurrentChange
    }
  }
}
</script>

<style scoped>
.demo-pagination-block+.demo-pagination-block {
  margin-top: 10px;
}

.demo-pagination-block .demonstration {
  margin-bottom: 16px;
}
</style>
